home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Interfaces & Libraries / Interfaces / AIncludes / Aliases.a < prev    next >
Encoding:
Text File  |  1993-12-02  |  5.4 KB  |  176 lines  |  [TEXT/MPS ]

  1. ;    File:        Aliases.a
  2. ;
  3. ;    Copyright:    © 1983-1993 by Apple Computer, Inc.
  4. ;                All rights reserved.
  5. ;
  6. ;    Version:    System 7.1 for ETO #11
  7. ;    Created:    Tuesday, March 30, 1993 18:00
  8. ;
  9. ;___________________________________________________________________________
  10.  
  11.     IF &TYPE('__INCLUDINGALIASES__') = 'UNDEFINED' THEN
  12. __INCLUDINGALIASES__    SET    1
  13.  
  14. ;*********************************************************************
  15. ;***************            Constants        **************************
  16. ;*********************************************************************
  17.  
  18. rAliasType        EQU         'alis'                    ;Aliases are stored as resources of this type
  19.  
  20. ; define alias resolution action rules mask
  21. kARMmountVol      EQU         $00000001                 ; mount the volume automatically
  22. kARMnoUI          EQU         $00000002                 ; no user interface allowed during resolution
  23. kARMmultVols      EQU         $00000008                 ; search on multiple volumes
  24. kARMsearch        EQU         $00000100                 ; search quickly
  25. kARMsearchMore    EQU         $00000200                 ; search further
  26. kARMsearchRelFirst    EQU     $00000400                 ; search target on a relative path first
  27.  
  28. ; define alias record information types
  29. asiZoneName       EQU         -3                        ; get zone name
  30. asiServerName     EQU         -2                        ; get server name
  31. asiVolumeName     EQU         -1                        ; get volume name
  32. asiAliasName      EQU         0                         ; get aliased file/folder/volume name
  33. asiParentName     EQU         1                         ; get parent folder name
  34.  
  35.  
  36. ;*********************************************************************
  37. ;***************            Data Structures     **********************
  38. ;*********************************************************************
  39.  
  40.  
  41. ; define the alias record that will be the blackbox for the caller
  42. AliasRecord       RECORD      0
  43. ; following two fields for application use
  44. userType          DS.L        1                         ; appl stored type
  45. aliasSize         DS.W        1                         ; alias record size in bytes, for appl usage
  46. ; what follows is a variable length amount of data that is private
  47.                   ENDR
  48.  
  49. ;*********************************************************************
  50. ;***************            Public Interfaces    **********************
  51. ;*********************************************************************
  52.  
  53. ;{****                        High Level Routines             ****}
  54.  
  55. ; create a new alias between fromFile-toFile and return alias
  56. ;    record handle.
  57. ;pascal OSErr NewAlias (    const FSSpec *fromFile,    //I
  58. ;                                const FSSpec *target,//I
  59. ;                                AliasHandle *alias)         //O
  60. ;= {0x7002,0xA823};
  61.  
  62.                   MACRO
  63.                   _NewAlias
  64.                   MOVEQ       #2,D0
  65.                   DC.W        $A823
  66.                   ENDM
  67.  
  68. ; create a minimal new alias for a target and return alias
  69. ;   record handle 
  70. ;pascal OSErr NewAliasMinimal (const FSSpec *target,    /*I*/
  71. ;                                AliasHandle *alias)             /*O*/
  72. ;= {0x7008,0xA823};
  73.  
  74.                   MACRO
  75.                   _NewAliasMinimal
  76.                   MOVEQ       #8,D0
  77.                   DC.W        $A823
  78.                   ENDM
  79.  
  80. ; create a minimal new alias from a target fullpath (optional zone and server name)
  81. ;    and return alias record handle ;
  82. ;pascal OSErr NewAliasMinimalFromFullpath (short fullpathLength, /*I*/
  83. ;                                const unsigned char *fullpath,     /*I*/
  84. ;                                const Str32 zoneName,            /*I*/
  85. ;                                const Str31 serverName,            /*I*/
  86. ;                                AliasHandle *alias)             /*O*/
  87. ;= {0x7009,0xA823};
  88.  
  89.                   MACRO
  90.                   _NewAliasMinimalFromFullpath
  91.                   MOVEQ       #9,D0
  92.                   DC.W        $A823
  93.                   ENDM
  94.  
  95. ; given an alias handle and fromFile, resolve the alias, update the
  96. ;    alias record and return aliased filename and wasChanged flag.
  97. ;pascal OSErr ResolveAlias(const FSSpec *fromFile, //I
  98. ;                                AliasHandle alias,            //O
  99. ;                                FSSpec *target,    //O
  100. ;                                Boolean *wasChanged)        //O
  101. ;= {0x7003,0xA823};
  102.  
  103.                   MACRO
  104.                   _ResolveAlias
  105.                   MOVEQ       #3,D0
  106.                   DC.W        $A823
  107.                   ENDM
  108.  
  109. ; given an alias handle and an index specifying requested alias information
  110. ;    type, return the information from alias record as a string.
  111. ;pascal OSErr GetAliasInfo(     AliasHandle alias,            //I
  112. ;                                AliasInfoType index,        //I
  113. ;                                Str63 theString)            //O
  114. ;= {0x7007,0xA823};
  115.  
  116.                   MACRO
  117.                   _GetAliasInfo
  118.                   MOVEQ       #7,D0
  119.                   DC.W        $A823
  120.                   ENDM
  121.  
  122.  
  123. ; given a file spec, return target file spec if input file spec is an alias.
  124. ;    It resolves the entire alias chain or one step of the chain.  It returns
  125. ;    info about whether the target is a folder or file; and whether the input
  126. ;    file spec was an alias or not.
  127. ;pascal OSErr ResolveAliasFile(FSSpec    *theSpec,            /*I/O*/    
  128. ;                                Boolean    resolveAliasChains, /*I*/
  129. ;                                Boolean    *targetIsFolder,    /*O*/
  130. ;                                Boolean    *wasAliased)        /*O*/
  131. ;= {0x700C,0xA823};
  132.  
  133.                   MACRO
  134.                   _ResolveAliasFile
  135.                   MOVEQ       #$0C,D0
  136.                   DC.W        $A823
  137.                   ENDM
  138.  
  139.  
  140. ;{****                        Low Level Routines            ****}
  141.  
  142. ; given an alias handle and fromFile, match the alias and return
  143. ;    aliased filename(s) and needsUpdate flag.
  144. ;pascal OSErr MatchAlias(const FSSpec *fromFile, //I
  145. ;                                unsigned long rulesMask,    //I
  146. ;                                const AliasHandle alias,    //I
  147. ;                                short *aliasCount,            //I/O
  148. ;                                FSSpecList aliasList,         //O
  149. ;                                Boolean *needsUpdate,        //O
  150. ;                                AliasFilterProcPtr aliasFilter, //I 
  151. ;                                Ptr yourDataPtr)            //I 
  152. ;= {0x7005,0xA823};
  153.  
  154.                   MACRO
  155.                   _MatchAlias
  156.                   MOVEQ       #5,D0
  157.                   DC.W        $A823
  158.                   ENDM
  159.  
  160. ; given a fromFile-toFile pair and an alias handle, update the
  161. ;    alias record pointed to by alias handle to represent newToFile
  162. ;    as the new alias.
  163. ;pascal OSErr UpdateAlias (const FSSpec *fromFile, //I
  164. ;                                const FSSpec *target, //I
  165. ;                                AliasHandle alias,            //I/O
  166. ;                                Boolean *wasChanged)        //O
  167. ;= {0x7006,0xA823};
  168.  
  169.                   MACRO
  170.                   _UpdateAlias
  171.                   MOVEQ       #6,D0
  172.                   DC.W        $A823
  173.                   ENDM
  174.  
  175.  
  176.     ENDIF    ; ...already included